<%@ page import="Bean.UserBean" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page errorPage="error.jsp" %>
<html>
<head lang="zh">
    <meta charset="utf-8" />
    <title>用户信息</title>
    <link rel="stylesheet" href="CSS/login.css">
</head>
<body>
<jsp:useBean id="userBean" scope="session" class="Bean.UserBean"/>
<%
    String bindHref = "#";
    String bind = "";
    boolean isBind = false;
    if(session.getAttribute("UserBean")==null) response.sendRedirect("http://localhost:8080/login.jsp");
    else{
        UserBean Bean = (UserBean)session.getAttribute("UserBean");
        userBean.setUsername(Bean.getUsername());
        userBean.setPassword(Bean.getPassword());
        userBean.login();
        isBind = !userBean.getDgut().equals("");
        if(!isBind){
            bindHref = "login/dgut?submit=绑定";
            bind = "绑定";
        }
    }
%>
<div class="top_div">
    <a href="login/dgut?submit=退出" style="margin:10px; float: right;">退出</a>
</div>
<div class="bg" style="width: 1500px;height: 100%;">
    <h2>
        <div class="base_color" style="color: #4a4848ad;">
            黑色沙漠
        </div>
    </h2>
    <div class="body" style="float: left;height: 100%;width: 24%;">
        <br>
        <div>
            <form action="upload" encType="multipart/form-data" method="POST">
                <div style="width: 100%;float: left;">
                    <span style="margin-left: 10px; float: left;font-size: 18px">
                        <input style="background-color:#ffffff00;border: none;color:#03a9f4;" type="submit" name="保存" value="保存头像">
                    </span>
                </div>
                <div>
                    <a href="" title="更换头像">
                        <label for="tx">
                            <img class="circle_img" src="images/<jsp:getProperty name="userBean" property="TX"/>" alt="头像">
                        </label>
                        <input style="opacity:0;width:0px;height:0px;" required="required" type="file" name="tx" id="tx">
                    </a>
                </div>
            </form>
        </div>
        <div>
            <div>
                <span style="color: #808080d9;font-size: 14px;"><jsp:getProperty name="userBean" property="xing"/>先生</span>
                <hr style="width: 360px">
                <div class="select_div">
                    <a class="" href="" style="font-size: 20px;">
                        个人信息
                    </a>
                </div>
            </div>
        </div>
        <br>
    </div>
    <div class="body" style="float: right;width: 74%;height: 100%;">
        <br>
        <div>
            <div style="width: 100%;float: left;">
                <span style="margin-left: 10px; float: left;font-size: 18px">基本信息</span>
                <a href="infor.jsp" style="margin-right: 10px; float: right;">更新</a>
            </div>
            <div>
                <span style="color: #808080d9;font-size: 20px;">个人信息</span>
                <hr style="width: 90%">
                <form action="inforSave.jsp" method="POST">
                    <div style="text-align: left;">
                        <div class="infor_div">
                            <div><label for="xing" style="">姓:</label></div>
                            <input class="input_text" type="text" required="required" name="xing" id="xing" value="<jsp:getProperty name="userBean" property="xing"/>" autofocus style="margin-top: 10px;width: 178px;">
                        </div>
                        <div class="infor_div">
                            <div><label for="ming">名:</label></div>
                            <input class="input_text" type="text" required="required" name="ming" id="ming" value="<jsp:getProperty name="userBean" property="ming"/>" autofocus style="margin-top: 10px;width: 178px;">
                        </div>
                        <div class="infor_div">
                            <div><label for="username">用户名:</label></div>
                            <input class="input_text" type="text" required="required" name="username" id="username" readonly="readonly" value="<jsp:getProperty name="userBean" property="username"/>" style="margin-top: 10px;">
                        </div>
                        <div class="infor_div">
                            <div><label for="dgut_username">莞工账号:</label></div>
                            <input class="input_text" type="text" name="dgut_username" id="dgut_username" readonly="readonly" value="<jsp:getProperty name="userBean" property="dgut"/>" style="margin-top: 10px;">
                            <a href="<%= bindHref %>"><%= bind %></a>
                        </div>
                        <div class="infor_div">
                            <input class="input_submit" type="submit" name="submit" value="保存">
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <br>
    </div>
</div>
</body>
</html>
